3.265 \(\int \sqrt {a+a \tan ^2(c+d x)} \, dx\)

Optimal. Leaf size=36 \[ \frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec ^2(c+d x)}}\right )}{d} \]

[Out]

arctanh(a^(1/2)*tan(d*x+c)/(a*sec(d*x+c)^2)^(1/2))*a^(1/2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3657, 4122, 217, 206} \[ \frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec ^2(c+d x)}}\right )}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + a*Tan[c + d*x]^2],x]

[Out]

(Sqrt[a]*ArcTanh[(Sqrt[a]*Tan[c + d*x])/Sqrt[a*Sec[c + d*x]^2]])/d

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4122

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(b*ff)
/f, Subst[Int[(b + b*ff^2*x^2)^(p - 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p
]

Rubi steps

\begin {align*} \int \sqrt {a+a \tan ^2(c+d x)} \, dx &=\int \sqrt {a \sec ^2(c+d x)} \, dx\\ &=\frac {a \operatorname {Subst}\left (\int \frac {1}{\sqrt {a+a x^2}} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {a \operatorname {Subst}\left (\int \frac {1}{1-a x^2} \, dx,x,\frac {\tan (c+d x)}{\sqrt {a \sec ^2(c+d x)}}\right )}{d}\\ &=\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec ^2(c+d x)}}\right )}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 31, normalized size = 0.86 \[ \frac {\cos (c+d x) \sqrt {a \sec ^2(c+d x)} \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + a*Tan[c + d*x]^2],x]

[Out]

(ArcTanh[Sin[c + d*x]]*Cos[c + d*x]*Sqrt[a*Sec[c + d*x]^2])/d

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 90, normalized size = 2.50 \[ \left [\frac {\sqrt {a} \log \left (2 \, a \tan \left (d x + c\right )^{2} + 2 \, \sqrt {a \tan \left (d x + c\right )^{2} + a} \sqrt {a} \tan \left (d x + c\right ) + a\right )}{2 \, d}, -\frac {\sqrt {-a} \arctan \left (\frac {\sqrt {a \tan \left (d x + c\right )^{2} + a} \sqrt {-a}}{a \tan \left (d x + c\right )}\right )}{d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)^2)^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(a)*log(2*a*tan(d*x + c)^2 + 2*sqrt(a*tan(d*x + c)^2 + a)*sqrt(a)*tan(d*x + c) + a)/d, -sqrt(-a)*arct
an(sqrt(a*tan(d*x + c)^2 + a)*sqrt(-a)/(a*tan(d*x + c)))/d]

________________________________________________________________________________________

giac [B]  time = 1.33, size = 66, normalized size = 1.83 \[ -\frac {{\left (\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1\right ) - \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1\right )\right )} \sqrt {a}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)^2)^(1/2),x, algorithm="giac")

[Out]

-(log(abs(tan(1/2*d*x + 1/2*c) + 1))*sgn(tan(1/2*d*x + 1/2*c)^4 - 1) - log(abs(tan(1/2*d*x + 1/2*c) - 1))*sgn(
tan(1/2*d*x + 1/2*c)^4 - 1))*sqrt(a)/d

________________________________________________________________________________________

maple [A]  time = 0.54, size = 34, normalized size = 0.94 \[ \frac {\sqrt {a}\, \ln \left (\sqrt {a}\, \tan \left (d x +c \right )+\sqrt {a +a \left (\tan ^{2}\left (d x +c \right )\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*tan(d*x+c)^2)^(1/2),x)

[Out]

1/d*a^(1/2)*ln(a^(1/2)*tan(d*x+c)+(a+a*tan(d*x+c)^2)^(1/2))

________________________________________________________________________________________

maxima [B]  time = 1.14, size = 65, normalized size = 1.81 \[ \frac {\sqrt {a} {\left (\log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right )\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(a)*(log(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x + c) + 1) - log(cos(d*x + c)^2 + sin(d*x + c)^2 -
 2*sin(d*x + c) + 1))/d

________________________________________________________________________________________

mupad [B]  time = 11.86, size = 41, normalized size = 1.14 \[ \left \{\begin {array}{cl} 0 & \text {\ if\ \ }a=0\\ \frac {\sqrt {a}\,\ln \left (\sqrt {a}\,\mathrm {tan}\left (c+d\,x\right )+\sqrt {a\,{\mathrm {tan}\left (c+d\,x\right )}^2+a}\right )}{d} & \text {\ if\ \ }a\neq 0 \end {array}\right . \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(c + d*x)^2)^(1/2),x)

[Out]

piecewise(a == 0, 0, a ~= 0, (a^(1/2)*log(a^(1/2)*tan(c + d*x) + (a + a*tan(c + d*x)^2)^(1/2)))/d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {a \tan ^{2}{\left (c + d x \right )} + a}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)**2)**(1/2),x)

[Out]

Integral(sqrt(a*tan(c + d*x)**2 + a), x)

________________________________________________________________________________________